package cn.ithers.blog.dao;

import cn.ithers.blog.pojo.Looper;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author: zhanghuan
 * @date: 2020/10/4 12:43
 * @description:
 */
public interface LoopDao extends JpaSpecificationExecutor<Looper>, JpaRepository<Looper, String> {
    Looper findOneById(String loopId);

    @Query(nativeQuery = true, value = "select *from tb_looper where state = ? order by create_time DESC ")
    List<Looper> listLoopByState(String state);
}
